//
//  WDjWholeData.m
//  wdj
//
//  Created by 蓝鳍互娱 on 2024/7/8.
//

#import "WDjWholeData.h"
#import "UIKit/UIKit.h"
@implementation WDjWholeData
+ (CGFloat)wholeScreewW{
    return [UIScreen mainScreen].bounds.size.width;
}
+ (CGFloat)wholeScreewH{
    return [UIScreen mainScreen].bounds.size.height;
}
+ (CGFloat)wholeScreewRatio:(CGFloat)width{
    return [self wholeScreewW] * width/750;
}
+ (BOOL)wholeIsPhoneX{
    BOOL isiPhoneX = NO;
    isiPhoneX = [[UIApplication sharedApplication] delegate].window.safeAreaInsets.bottom > 0.0;
    return isiPhoneX;
}
+ (CGFloat)wholeStateH{
    return [UIApplication sharedApplication].windows.firstObject.windowScene.statusBarManager.statusBarFrame.size.height;
}
+ (CGFloat)wholeTabBarH{
    return [self wholeIsPhoneX] ? 83 : 39;
}
+ (CGFloat)wholeTopSafeH{
    return [self wholeIsPhoneX] ? 44 : [self wholeStateH];
}
+ (CGFloat)wholeBottomSafeH{
    return [self wholeIsPhoneX] ? 34 : 0;
}

+ (UIImage *)wholeImageNamed:(NSString *)imgName{
    return [UIImage imageNamed:imgName];
}
+ (UIColor *)wholeColorHexString:(NSString *)colorHexString withAlph:(CGFloat)alpha{
    unsigned rgbValue = 0;
    colorHexString = [colorHexString stringByReplacingOccurrencesOfString:@"#" withString:@""];
    [[NSScanner scannerWithString:colorHexString] scanHexInt:&rgbValue];
    return [UIColor colorWithRed:((rgbValue & 0xFF0000) >> 16)/255.0 green:((rgbValue & 0xFF00) >> 8)/255.0 blue:(rgbValue & 0xFF)/255.0 alpha:alpha];
}
+ (UIColor *)wholeColorHexString:(NSString *)colorHexString{
    return [self wholeColorHexString:colorHexString withAlph:1.0];
}
+ (NSString *)wdjUrlForSandboxUrl{
    return @"https://sandbox.itunes.apple.com/verifyReceipt";
}
+ (NSString *)wdjUrlForShiDu{
    NSString * lat = [WDJPublicData defaultManager].wdjLocalLat;
    NSString * lon = [WDJPublicData defaultManager].wdjLocalLon;
    NSString * shiDuUrl = @"http://ruyi.temperature.lbbtech.cn/lbb-h5/wenduji/ruyi/humidity.html?lat=xxxlat&lon=xxxlon";
    shiDuUrl = [shiDuUrl stringByReplacingOccurrencesOfString:@"xxxlat" withString:lat];
    shiDuUrl = [shiDuUrl stringByReplacingOccurrencesOfString:@"xxxlon" withString:lon];
    return shiDuUrl;
}
+ (NSString *)wdjUrlForWenDu{
    NSString * lat = [WDJPublicData defaultManager].wdjLocalLat;
    NSString * lon = [WDJPublicData defaultManager].wdjLocalLon;
    NSString * wenDuUrl = @"http://ruyi.temperature.lbbtech.cn/lbb-h5/wenduji/ruyi/temperature.html?lat=xxxlat&lon=xxxlon";
    wenDuUrl = [wenDuUrl stringByReplacingOccurrencesOfString:@"xxxlat" withString:lat];
    wenDuUrl = [wenDuUrl stringByReplacingOccurrencesOfString:@"xxxlon" withString:lon];
    return wenDuUrl;
}
+ (NSString *)wdjUrlForCityName{
    NSCharacterSet * characterSet = [NSCharacterSet URLQueryAllowedCharacterSet];
    NSString * cityName = [[WDJPublicData defaultManager].wdjLocalCityName stringByAddingPercentEncodingWithAllowedCharacters:characterSet];
    NSString * cityUrl = @"http://ruyi.temperature.lbbtech.cn/lbb-h5/wenduji/ruyi/weather.html?cityName=xxxx";
    cityUrl = [cityUrl stringByReplacingOccurrencesOfString:@"xxxx" withString:cityName];
    
    return cityUrl;
}
+ (NSString *)wdjUrlForVipPrice{
    return @"http://ruyi.temperature.asdfa1sdg.top/lbbserves/api/appdingyue/info";
}
+ (NSString *)wdjUrlForMaiDian{
    return @"http://ruyi.temperature.asdfa1sdg.top/lbbmajiabao/api/maidian";
}
+ (NSString *)wdjPublicForBundId{
    return @"com.rytemp.ac";
}
+ (NSString *)wdjPublicForProductId{
    return @"kankannianhuiyuan";
}
+ (NSString *)wdjPublicForProductKey{
    return @"b93e9d9edffb49549cf7a94bd6d1430a";
}

+ (NSString *)wdjPublicForUserAgreement{
    return @"https://lgg69az5eh.feishu.cn/docx/Ym8od233yoC2D6xR8spcZAqinhh?from=from_copylink";
}
+ (NSString *)wdjPublicForPriAgreement{
    return @"https://lgg69az5eh.feishu.cn/docx/JpS9dljnXof7fMxlQLGcqGsknEP?from=from_copylink";
}
@end
